<?php
	$employeeID = mysql_real_escape_string($_REQUEST["filter"]["filters"][0]["value"]);
	include("include0.php");
	
	$arr = array();
	
	$rs = mysql_query(
			"select trim(t.TerritoryDescription) as TerritoryDescription
			 from Territories t
			 inner join EmployeeTerritories et on t.TerritoryID = et.TerritoryID
			 inner join Employees e on et.EmployeeID = e.EmployeeID
			 where e.EmployeeID = " . $employeeID
	);
	
	while($obj = mysql_fetch_object($rs))
	{
		$arr[] = $obj;	
	}
	
	header("Content-type: application/json");
	echo "{\"data\":" . json_encode($arr). "}";
?>